<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('新增来电记录')"/>
    <link th:href="@{/ajax/libs/bootstrap-tagsinput/tagsinput.css}" rel="stylesheet">
    <link th:href="@{/ajax/libs/jQuery-ui/jquery-ui.css}" rel="stylesheet">
    <link rel="stylesheet" type="text/css" th:href="@{/ajax/libs/qxEasyUI/themes/default/easyui.css}">
</head>


<body style="background-color: #F4F6FA">
<div class="main-content" style="margin: 0;padding: 0">

    <form id="form-user-add" class="form-horizontal" th:object="${telGetDeal}" style="background-color: #F4F6FA">
        <input name="pkId" id="pkId" type="hidden" value="0">
        <input name="liftWorkNo" th:field="*{liftWorkNo}" type="hidden">
        <input name="liftWorker" th:field="*{liftWorker}" type="hidden">
        <input name="liftTelNo" th:field="*{liftTelNo}" type="hidden">
        <input name="callId" th:field="*{callId}" type="hidden">
        <input name="tapeId" id="tapeId" th:field="*{tapeId}" type="hidden">
        <input name="fromTime" id="tmFrom" type="hidden" th:field="*{fromTime}">
        <input type="hidden" id="sensitiveId" name="sensitiveId"/>
        <input name="fmCerName" type="hidden" value="-1">
        <input name="fmCerNo" type="hidden" value="">
        <input name="fmEmail" type="hidden" value="">
        <input name="flagInt" type="hidden" value="0"/>
        <input name="flagString" type="hidden" value=""/>
        <input name="spareInt" type="hidden" value="0"/>
        <input name="spareString" type="hidden" value=""/>
        <input name="fkstring" type="hidden" value=""/>
        <div class="col-sm-12" style="display: flex">
            <!--     左       -->
            <div class="col-sm-7 entering-page">
                <!--    历史来电    -->
                <div class="col-sm-12 entering-top">
                    <div>历史来电数:<strong>[[${history}]]/[[${noLike}]]</strong></div>
                    <div>常涉问题:<strong>[[${problem}]]</strong></div>
                </div>
                <!--事发地址-->
                <div class="col-sm-12 entering-mt">
                    <div class="form-group">
                        <label class="col-sm-2 control-label entering-pd">事发地址：</label>
                        <div class="col-sm-8">
                            <input name="fmAddress" id="fmAddress" placeholder="请输入"
                                   class="form-control scene theAddress" type="text">
                        </div>
                        <div class="col-sm-1">
                            <button type="button" class="btn btn-sm btn-primary"
                                    style="margin: 3px 0px 0px -25px;color: #206ef7;background-color: white"
                                    onclick="sensitivity('save')">敏感信息
                            </button>
                        </div>
                        <div class="col-sm-1">
                            <button type="button" class="btn btn-sm btn-primary"
                                    style="margin: 3px 0px 0px -15px;color: #206ef7;background-color: white"
                                    onclick="aiAnswering()">智能问答
                            </button>
                        </div>
                    </div>
                </div>
                <!--来电类容-->
                <div class="col-sm-12">
                    <div class="form-group">
                        <label class="col-xs-2 control-label is-required entering-pd">来电内容：</label>
                        <div class="col-xs-10">
                            <textarea name="fmContent" id="fmContent" maxlength="1000" class="form-control phoneRemark"
                                      rows="3"
                                      style="height: 100px" required></textarea>

                            <span>还可以输入<i class="phoneRemarkI">1000</i>个文字</span>
                            <button type="button" class="btn btn-sm btn-primary" style="position: absolute;right: 15px"
                                    onclick="identification()">智能预载
                            </button>

                        </div>
                    </div>
                </div>
                <!--来电人名等，关键词等，分两个部分-->
                <!--来电人名等-->
                <div class="col-sm-6">
                    <div class="col-sm-12">
                        <div class="form-group">
                            <label class="col-sm-4 control-label is-required entering-pd">地区：</label>
                            <div class="col-sm-8">
                                <select name="fmAreaNo" id="fmAreaNo" required
                                        th:with="area=${@commonServiceImpl.findArea()}"
                                        onchange="dropChgSendTextOnly(this,'fmAreaName');"
                                        class="form-control formSelect">
                                    <option value="">--请选择--</option>
                                    <th:block th:each="item : ${area}">
                                        <option th:text="${item['CSText']}" th:value="${item['CSValue']}"></option>
                                    </th:block>
                                </select>
                                <input type="hidden" name="fmAreaName" id="fmAreaName" th:value="*{fmAreaName}"/>
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-12">
                        <div class="form-group">
                            <label class="col-sm-4 control-label is-required entering-pd">来电人名：</label>
                            <div class="col-sm-8">
                                <input name="fromName" id="fromName" placeholder="请输入" value="匿名"
                                       class="form-control phoneName"
                                       type="text"
                                       maxlength="5" required="">
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-12">
                        <div class="form-group">
                            <label class="col-sm-4 control-label entering-pd is-required"> 被叫号码：</label>
                            <div class="col-sm-8">
                                <input type="text" id="fromTelC" class="form-control relationPhone" name="fromTelC" th:field="*{fromTelC}" readonly/>
                            </div>
                        </div>
                    </div> <div class="col-sm-12">
                    <div class="form-group">
                        <label class="col-sm-4 control-label entering-pd is-required">联系电话：</label>
                        <div class="col-sm-5">
                            <input name="fromTelA" placeholder="请输入" id="fromTelA" class="form-control relationPhone"
                                   type="text" readonly
                                   maxlength="20" required="" th:field="*{fromTelA}" >
                        </div>
                        <div class="col-sm-3">
                            <button class="form-control copyBtn" id="copyBtn" onclick="copyPhoneNum();return false;" style="border: 1px solid #206ef7;color: #206ef7;">复制</button>
                        </div>
                    </div>
                </div>
                    <div class="col-sm-12">
                        <div class="form-group">
                            <label class="col-sm-4 control-label is-required entering-pd">来电类别：</label>
                            <div class="col-sm-8">
                                <select name="dfmClaNo" id="dfmClaNo" required
                                        th:with="telTypes=${@commonServiceImpl.findTelType()}"
                                        onchange="dropChgSendTextOnly(this,'dfmClaName');"
                                        class="form-control formSelect">
                                    <option value="">--请选择--</option>
                                    <th:block th:each="item : ${telTypes}">
                                        <option th:text="${item['CSText']}" th:value="${item['CSValue']}"></option>
                                    </th:block>
                                </select>
                                <input type="hidden" name="dfmClaName" id="dfmClaName" th:value="*{dfmClaName}"/>
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-12">
                        <div class="form-group">
                            <label class="col-sm-4 control-label entering-pd is-required">内容类别：</label>
                            <div class="col-sm-8">
                                <input id="qxCT" name="qxCT" style="width:197px;height:31px;" required>
                                <input id="txtDcntAcode" name="dcntAcode" type="hidden" value=""/>
                                <input id="txtDCntAName" name="dcntAname" type="hidden" value=""/>
                            </div>
                        </div>
                    </div>
                    <!--                    <div class="col-sm-12">-->
                    <!--                        <div class="form-group">-->
                    <!--                            <label class="col-sm-4 control-label entering-pd">影响范围：</label>-->
                    <!--                            <div class="col-sm-8">-->
                    <!--                                <input name="userName" placeholder="请输入" class="form-control" type="text"-->
                    <!--                                       maxlength="30" required="">-->
                    <!--                            </div>-->
                    <!--                        </div>-->
                    <!--                    </div>-->

                    <div class="col-sm-12">
                        <div class="form-group">
                            <label class="col-sm-4 control-label entering-pd">被诉主体：</label>
                            <div class="col-sm-8">
                                <input name="accSubject" placeholder="请输入" class="form-control" type="text"
                                       maxlength="30" id="subject">
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-12">
                        <div class="form-group">
                            <label class="col-sm-4 control-label is-required entering-pd">流水号：</label>
                            <div class="col-sm-8">
                                <input name="wsCode" type="text" class="form-control scene theAddress" id="wsCode" readonly/>
                            </div>
                        </div>
                    </div>

                    <div class="col-sm-12">
                        <div class="form-group">
                            <label class="col-xs-4 control-label entering-pd">交办意见：</label>
                            <div class="col-xs-8">
                                <select id="xDealDescSelect" onchange="dropChgSendTextOnly(this,'xdealDesc');"
                                        th:with="district=${@commonServiceImpl.findOpinion()}"
                                        class="form-control formSelect">
                                    <option value="">--请选择--</option>
                                    <option th:each="item : ${district}" th:text="${item['CSText']}"
                                            th:value="${item['CSValue']}"></option>
                                </select>
                            </div>
                        </div>
                        <div>
                        <textarea name="xdealDesc" id="xdealDesc" maxlength="3500" class="form-control opinion"
                                  rows="5"></textarea>
                            <span>还可以输入<i class="opinionI">3500</i>个文字</span>
                        </div>
                    </div>


                    <!--                    <div class="col-sm-12">-->
                    <!--                        <div class="form-group">-->
                    <!--                            <label class="col-sm-4 control-label entering-pd">坐席备注：</label>-->
                    <!--                            <div class="col-sm-8">-->
                    <!--                                <select id="xSysDescSelect" onchange="dropChgSendTextOnly(this,'xsysDesc');"-->
                    <!--                                        th:with="district=${@commonServiceImpl.findSeatsRemark()}"-->
                    <!--                                        class="form-control formSelect">-->
                    <!--                                    <option value="">&#45;&#45;请选择&#45;&#45;</option>-->
                    <!--                                    <option th:each="item : ${district}" th:text="${item['CSText']}"-->
                    <!--                                            th:value="${item['CSValue']}"></option>-->
                    <!--                                </select>-->

                    <!--                                <textarea name="xsysDesc" id="xsysDesc" maxlength="3500"-->
                    <!--                                          class="form-control SeatsRemark"-->
                    <!--                                          rows="3"></textarea>-->
                    <!--                                <span>还可以输入<i class="SeatsRemarkI">3500</i>个文字</span>-->
                    <!--                            </div>-->
                    <!--                        </div>-->
                    <!--                    </div>-->


                </div>

                <div class="col-sm-6">
                    <div class="col-sm-12">
                        <div class="form-group">
                            <label class="col-xs-4 control-label">性别：</label>
                            <div class="col-xs-8">
                                <label class="check-box">
                                    <input name="fromSex" id="fromSex1" value="1" type="radio" checked>男
                                </label>
                                <label class="check-box">
                                    <input name="fromSex" id="fromSex0" value="0" type="radio">女
                                </label>
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-12">
                        <div class="form-group">
                            <label class="col-xs-4 control-label">屏蔽号码：</label>
                            <div class="col-xs-8">
                                <label class="check-box">
                                    <input name="hideTel" value="5" type="radio">是
                                </label>
                                <label class="check-box">
                                    <input name="hideTel" value="0" type="radio" checked>否
                                </label>
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-12">
                        <div class="form-group">
                            <label class="col-xs-4 control-label">同意公开：</label>
                            <div class="col-xs-8">
                                <label class="check-box">
                                    <input name="openFrom" value="1" type="radio">是
                                </label>
                                <label class="check-box">
                                    <input name="openFrom" value="0" type="radio" checked>否
                                </label>
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-12">
                        <div class="form-group">
                            <label class="col-xs-4 control-label">重复来电：</label>
                            <div class="col-xs-8">
                                <label class="check-box">
                                    <input name="repeatFlag" value="1" type="radio">是
                                </label>
                                <label class="check-box">
                                    <input name="repeatFlag" value="0" type="radio" checked>否
                                </label>
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-12">
                        <div class="form-group">
                            <label class="col-xs-4 control-label">紧急联系：</label>
                            <div class="col-xs-8">
                                <label class="check-box">
                                    <input name="mark" value="1" type="radio">是
                                </label>
                                <label class="check-box">
                                    <input name="mark" value="0" type="radio" checked>否
                                </label>
                            </div>
                        </div>
                    </div>

                    <!--bootstrap关键词等-->
                    <div class="col-sm-12">
                        <div class="form-group">
                            <label class="col-xs-4 control-label">关键词标签：</label>
                            <div class="col-xs-8">
                                <input class="antistop" name="keyWord" id="keyWord" type="text" value=""
                                       data-role="tagsinput">
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-12">
                        <div class="form-group">
                            <label class="col-xs-4 control-label">提取码：</label>
                            <div class="col-xs-8">
                                <input name="wsKey" class="form-control scene theAddress" id="wsKey" value="" type="text" readonly>
                            </div>
                        </div>
                    </div>
                    <div class="col-sm-12">
                        <div class="form-group">
                            <label class="col-xs-4 control-label">坐席备注：</label>
                            <div class="col-xs-8">
                                <select id="xSysDescSelect" onchange="dropChgSendTextOnly(this,'xsysDesc');"
                                        th:with="district=${@commonServiceImpl.findSeatsRemark()}"
                                        class="form-control formSelect">
                                    <option value="">--请选择--</option>
                                    <option th:each="item : ${district}" th:text="${item['CSText']}"
                                            th:value="${item['CSValue']}"></option>
                                </select>
                            </div>
                        </div>
                        <div>
                            <textarea name="xsysDesc" id="xsysDesc" maxlength="3500"
                                      class="form-control SeatsRemark"
                                      rows="5"></textarea>
                            <span>还可以输入<i class="SeatsRemarkI">3500</i>个文字</span>
                        </div>
                    </div>
                </div>
                <div class="col-sm-12 entering-bt">
                    <button type="button" class="btn btn-sm btn-warning"
                            onclick="draft('存草稿','101')">存草稿
                    </button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <button type="button" class="btn btn-sm btn-primary"
                            onclick="draft('转值班长处理','120')">转值班长
                    </button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <button type="button" class="btn btn-sm btn-info"
                            onclick="draft('坐席当场解答','131')">当场解答
                    </button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <button type="button" class="btn btn-sm btn-success"
                            onclick="draft('无效来电 当场作废','132')">无效来电
                    </button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <input id="tbStateDesc" name="stateDesc" value="草稿" type="hidden"/>
                    <input id="stateFlag" name="stateFlag" value="101" type="hidden"/>
                    <button type="button" class="btn btn-sm btn-warning" onclick="$.modal.close()">关闭</button>&nbsp;
                </div>
            </div>

            <!--     右       -->
            <div class="col-sm-5 entering-page">
                <div class="col-sm-12">
                    <ul class="nav nav-pills nav-tabs" style="margin: 10px 0 10px 0;" id="navUL">
                        <li role="presentation"><a href="javascript:;" target="myIframe" class="current"
                                                   id="telHistory">历史来电</a></li>
                        <li role="presentation"><a href="javascript:;" target="myIframe" id="phoneWork">同号工单来电</a></li>
                        <li role="presentation" class="recommendli"><a href="" target="myIframe"
                                                                       id="recommend">类案推荐</a></li>
                        <!--                        <li role="presentation"><a href="home3.html" target="myIframe">相关政策</a></li>-->
                    </ul>
                    <iframe style="width: 100%;height: 600px;border: medium none" name="myIframe" id="myIframe"
                            src=""></iframe>
                </div>
            </div>
        </div>


    </form>


</div>


<th:block th:include="include :: footer"/>
<script th:src="@{/ajax/libs/bootstrap-tagsinput/tagsinput.min.js}"></script>
<script th:src="@{/ajax/libs/jQuery-ui/jquery-ui.js}"></script>
<script th:src="@{/ajax/libs/qxEasyUI/jquery.easyui.min.js}"></script>
<script th:src="@{/js/teladd.js}"></script>
<script th:src="@{/js/sensitivity.js}"></script>

<script>
    // 点击同号工单
    $('#phoneWork').click(function () {
        var url = '/jackPerLine.html?fromTelA=' + $('#fromTelA').val();
        document.getElementById('myIframe').src = url;
    });
    $('#qxCT').width($('input[name="fromName"]').width() + 10);
    // 选择内容分类
    $('#qxCT').combotree({
        url: '/system/common/findContentCate',
        required: false,
        onSelect: function (record) {
            $("#txtDcntAcode").val(record.id);
            $("#txtDCntAName").val(record.text);
            $('.combo-text').removeClass('error');
        }
    });

    var prefix = ctx + "system/mTelRcd";
    $(document).ready(function () {
        // $("#tmFrom").val(DateToStr());
        // $('#telHistory').click();
        document.getElementById("telHistory").click();
    })
    var sensitiveInfo = new Object()

    function setSensitiveId(id) {
        // sensitiveInfo.cardId = data[0].value;
        // sensitiveInfo.militaryId = data[1].value;
        // sensitiveInfo.realName = data[2].value;
        // sensitiveInfo.medicalCardNum = data[3].value;
        // sensitiveInfo.other = data[4].value;
        $('#sensitiveId').val(id);
    }

    //    存草稿
    function draft(fpStr, str) {
        $("#tbStateDesc").val(fpStr);
        $('#stateFlag').val(str);
        if (str =='132'){
            $("#fmAreaNo").val(909909);
            $("#fmAreaNo").find("option[value=909909]").attr("selected",true);
            $('#fmContent').val('无效来电');
            $('#dfmClaNo').val('99');
            $("#dfmClaNo").find("option[value=99]").attr("selected",true);
            $("#txtDcntAcode").val(11490401);
            $("#txtDCntAName").val('无效来电');
            $("#txtDcntAcode").find("option[value=11490401]").attr("selected","selected");
            $('#xsysDesc').val('已当场处理');
        }
        var flag = $.validate.form();
        if ($("#txtDcntAcode").val() == '') {
            $('.combo-text').addClass('error');
            flag = false;
        } else {
            $('.combo-text').removeClass('error');
        }
        if (flag) {
            let data = $('#form-user-add').serializeArray();
            if (!$.isEmptyObject(site)) {
                $('#fmAreaName').val(site.district);
                data.push({name: "uid", value: site.uid});
                data.push({name: "name", value: site.name});
                data.push({name: "address", value: site.address});
                data.push({name: "alias", value: site.alias});
                data.push({name: "tag", value: site.tag});
                data.push({name: "province", value: site.province});
                data.push({name: "city", value: site.city});
                data.push({name: "district", value: site.district});
                data.push({name: "telephone", value: site.telephone});
                data.push({name: "locationx", value: site.location.x});
                data.push({name: "locationy", value: site.location.y});
                data.push({name: "distance", value: site.distance});
                data.push({name: "brandName", value: site.brandName});
                data.push({name: "aoiName", value: site.aoiName});
                data.push({name: "storeComment", value: site.storeComment});
                data.push({name: "storePeriod", value: site.storePeriod});
                data.push({name: "faceId", value: site.faceId});
                data.push({name: "bid", value: site.bid});
            }
            if (!$.isEmptyObject(sensitiveInfo)) {
                data.push({name: "cardId", value: sensitiveInfo.cardId});
                data.push({name: "militaryId", value: sensitiveInfo.militaryId});
                data.push({name: "realName", value: sensitiveInfo.realName});
                data.push({name: "medicalCardNum", value: sensitiveInfo.medicalCardNum});
                data.push({name: "other", value: sensitiveInfo.other});
            }

            var url = prefix + "/save";
            if ($('#pkId').val() > 0) {
                url = prefix + "/edit";
            }
            $.ajax({
                url: url,
                type: 'post',
                dataType: 'json',
                data: data,
                success: function (result) {
                    console.log(result)
                    console.log(result.data)
                    if (result.data && result.data != '') {
                        $('#pkId').val(result.data.pkId);
                        $('#wsCode').val(result.data.wsCode);
                        $('#wsKey').val(result.data.wsKey);
                    }
                    $.modal.msgSuccess(result.msg);
                },
                error: function (e) {
                    $.modal.msgError('服务器内部错误');
                },

            });
        }
    }

    function doSubmit(index, layero) {
        var body = layer.getChildFrame('body', index);
        $("#treeId").val(body.find('#treeId').val());
        $("#treeName").val(body.find('#treeName').val());
        layer.close(index);
    }

    function value(data) {
        $("#fmAddress").val(data.fmAddress)
        $("#fmContent").val(data.fmContent)
        $("#fromTelA").val(data.fromTelA)
        $("#fromTelB").val(data.fromTelA)
        $("#fromName").val(data.fromName)
        $("#dfmClaNo").val(data.dfmClaNo)
        $('#qxCT').combobox('setText', data.dcntAname);
        $("#txtDcntAcode").val(data.dcntAcode)
        $("#txtDCntAName").val(data.dcntAname)
        $("#subject").val(data.accSubject)
        $("#keyWord").val(data.keyWord)
        $("input[name='hideTel']").attr("checked", data.hideTel)
        $("input[name='openFrom']").attr("checked", data.openFrom)
        $("input[name='repeatFlag']").attr("checked", data.repeatFlag)
        $("input[name='mark']").attr("checked", data.mark)
        $("#xSysDescSelect").val(data.xsysDesc)
        $("#xsysDesc").val(data.xsysDesc)
        $("#xDealDescSelect").val(data.xdealDesc)
        $("#xdealDesc").val(data.xdealDesc)
    }

    $('#fromSex1,#fromSex0').on('ifClicked', function (obj) {
        if (this.value == 1) {
            $('#fromName').val('先生');
        } else if (this.value == 0) {
            $('#fromName').val('女士');
        }
    })

    $("#dfmClaName").val("投诉举报");
    $("#dfmClaNo").val("40");

    var tape = window.parent.RecordFileGet && window.parent.RecordFileGet() || "-1";
    $("#tapeId").val(tape);

    //将历史来电/同号工单的信息填充到页面
    function copy(type,dataList){ //0为历史工单 ,1为同号工单
        var data;
        var str1;
        var str2;
        if(type==0){
            data=dataList;
            str1='情况：来话人来电反映';
            str2='的相同问题,';
        }else {
            data=dataList.telGetDeal;
            str1='来话人反映';
            str2='相同问题';
        }
        // $('#subject').val(data.accSubject);
        $('#fmAddress').val(data.fmAddress);
        $('#fromName').val(data.fromName);
        if (data.wkPkId != -1){
            let content = data.fmContent;
            if (content.indexOf(str1) == -1) {
                console.log(data.wkFmNo)
                $('#fmContent').val(str1 + data.wkFmNo + str2 + content);
            }else{
                content = content.substr(28);
                $('#fmContent').val(str1+ data.wkFmNo + str2 + content);
            }
        } else{
            $('#fmContent').val(data.fmContent);
        }
        $('#keyWord').val(data.keyWord);
        $('#hideTel5').checked = data.hideTel == 5 ? true : $('#hideTel0').checked = false;
        $('#repeatFlag1').checked = data.repeatFlag == 1 ? true : $('#repeatFlag0').checked = false;
        $('#openX1').checked = data.openX == 1 ? true : $('#openX0').checked = false;
        $('#fromSex1').checked = data.fromSex == '1' ? true : $('#fromSex0').checked = false;
        $('#incidence').val(data.affectScope);
        var areas = $('#fmAreaNo').find('option');
        for (var i = 0; i < areas.length; i++) {
            if (areas[i].value == data.fmAreaNo) {
                areas[i].selected = true;
                break;
            }
        }
        $('#fmAreaName').val(data.fmAreaName);
        var dfms = $('#dfmClaNo').find('option');
        for (var i = 0; i < dfms.length; i++) {
            if (dfms[i].value == data.dfmClaNo) {
                dfms[i].selected = true;
                break;
            }
        }
        $('#dFmClaName').val(data.dfmClaName);
        $('#qxCT').combobox('setText', data.dcntAname);
        $('#txtDcntAcode').val(data.dcntAcode);
        $('#txtDCntAName').val(data.dcntAname);
        $('#xsysDesc').val(data.xsysDesc);
        $('#xdealDesc').val(data.xdealDesc);
    }

    function telDetail(wfid, tid) {
        var url = '';
        var title = '';
        var width = '85%';
        var height = '80%';

        if (wfid == -1) {
            url = ctx + 'system/lookup/telGetDetail/'+tid;
            title = '通话记录详情';
        }else if(wfid==1){
            url = '/system/lookup/telOrderDetail/'+tid;
            title = '同号工单详情';
        }else {
            url = ctx + 'system/test/caseDetail/'+wfid;
            title = '通话工单详情';
        }
        $.modal.openDialog(title, url, width, height);
    }

    function copyPhoneNum() {
        var t=document.getElementById("fromTelA");
        t.select();
        document.execCommand("Copy");
        layer.msg("复制成功",{icon:1,time:2000});
    }

    function aiAnswering() {
        let url = '/system/bdapi/intelligent/ai';
        let title = '智能问答';
        let width = '50%';
        let height = '90%';
        $.modal.openDialog(title, url, width, height);
    }

    // var clipboard = new ClipboardJS('#copyBtn', {
    //     text: function (trigger) {
    //         return document.getElementById("fromTelA").value;
    //     }
    // });
    //
    // clipboard.on('success', function (e) {
    //     layer.msg("复制成功",{icon:1,time:2000});
    //     return;
    // });
    //
    // clipboard.on('error', function (e) {
    //     layer.msg("复制失败",{icon:2,time:2000});
    // });
</script>
</body>
</html>